Set up NuGet trusted publishing.#584
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
| uses: nuget/login@v1 | ||
| id: nuget-login | ||
| with: | ||
| user: ${{ vars.NUGET_USER }} |
There was a problem hiding this comment.
Just curious where NUGET_USER would be set?
There was a problem hiding this comment.
I set it just now in https://github.com/TileDB-Inc/TileDB-CSharp/settings/environments/8874688022/edit.
There was a problem hiding this comment.
I only see actions secrets in the settings panel so probably I am lacking permissions for environments settings, but SGTM 👍
| run: | | ||
| cd pack | ||
| dotnet nuget push "*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.TILEDB_CSHARP_NUGET_KEY }} | ||
| dotnet nuget push "*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ steps.nuget-login.outputs.NUGET_API_KEY || secrets.NUGET_KEY }} |
There was a problem hiding this comment.
Reminder to update the secret variable name when you are ready to use this
There was a problem hiding this comment.
After this PR gets merged, I will delete the TILEDB_CSHARP_NUGET_KEY secret. I used the NUGET_KEY secret (and the just-added NUGET_FEED variable) to easily support publishing nightly packages to an alternative feed that does not support trusted publishing.
The whole arrangement follows what I've been doing in some personal projects (example).
release environment
nightly environment
There was a problem hiding this comment.
Very nice, thanks for sharing!
|
For the record, trusted publishing failed because as it turns out, it is not yet available for organizations (NuGet/NuGetGallery#10581). Thankfully, the updated workflowallows switching between API key-based publishing without changes to source code. I pushed the package manually, and updated the |
Fixes CORE-372.